package com.zhuge_new.Adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhuge_new.R;
import com.zhuge_new.bean.DepositBean;
import com.zhuge_new.share.BaseHttp;

import java.util.List;

/**
 * Created by lenovo on 2018-09-15.
 */

public class DepositAdapter extends BaseQuickAdapter<DepositBean.DepositcardsBean,BaseViewHolder> {


    private Context context;
    private DepositBean depositBean;
    private String card;
    public DepositAdapter(Context context, DepositBean depositBean) {
        super(R.layout.item_examine,depositBean.getDepositcards());
        this.context=context;
        this.depositBean=depositBean;
    }


    @Override
    protected void convert(BaseViewHolder helper, DepositBean.DepositcardsBean item) {

        ImageView imageView=helper.getView(R.id.iv_yhlogo);
        Glide.with(context).load(BaseHttp.baseImg1+item.getBankLogo()).into(imageView);

        helper.setText(R.id.card_name,item.getBank());
        for (int i=0;i<depositBean.getDepositcards().size();i++){
            card = item.getDepositcard().replaceAll("\\d{4}(?!$)", "$0 ");
        }
        helper.setText(R.id.card_No,card);
    }
}
